<include file="Public:header"/>

<!--主体-->
<div class="wrap">
    <div class="con-layer">
        <h3 style="margin-bottom:20px;">金币余额：{$user_yue}金币</h3>
        <table width="90%" border="0" cellspacing="0" cellpadding="0">
            <tr class="title">
                <td><a class="active" href="javascript:;" onClick="needgoldsnum(50,this)">50元红包</a></td>
                <td><a href="javascript:;" onClick="needgoldsnum(100,this)">100元红包</a></td>
                <td><a href="javascript:;" onClick="needgoldsnum(101,this)">100元以上</a></td>
            </tr>
            <tr class="title more_jine" style="display:none;">
                <td colspan="1">输入金额</td>
                <td colspan="3"><input type="number" value="" class="text-m paymorenum_input" style="width:100%;" > </td>
            </tr>

        </table>
        <p class="margintop">需要：<font class="needgoldsnum">5700</font>金币</p>
    </div>
    <a class="btn-dota tobuygo_btn" href="./index.php?a=tobuygo&m=index&bnum=50">立即兑换</a>
</div>
<script type="text/javascript">
function needgoldsnum(t,obj){
	$(".title a.active").removeClass();
	$(obj).addClass("active");
	if(t==50){
		$(".needgoldsnum").text(5700);
        $(".more_jine").hide();
		$(".tobuygo_btn").attr("href","./index.php?a=tobuygo&m=index&bnum="+50+"");
	}
    if(t==100){
        $(".needgoldsnum").text(11000);
        $(".more_jine").hide();
        $(".tobuygo_btn").attr("href","./index.php?a=tobuygo&m=index&bnum="+100+"");
    }
    if(t>=101){
        $(".needgoldsnum").text("");
        $(".more_jine").show();
        $(".tobuygo_btn").attr("href","./index.php?a=tobuygo&m=index&bnum="+t+"");
    }
}
$(function () {
    $('.paymorenum_input').bind('input propertychange', function() {
        var morenum=$(this).val();
        if(morenum>100){
            var moregolds=Math.floor(morenum*110);
            $(".needgoldsnum").text(moregolds);
            $(".tobuygo_btn").attr("href","./index.php?a=tobuygo&m=index&bnum="+morenum+"");
        }else if(morenum<0){
            $(this).val(100);
            var moregolds=Math.floor(100*110);
            $(".needgoldsnum").text(moregolds);
            $(".tobuygo_btn").attr("href","./index.php?a=tobuygo&m=index&bnum="+100+"");

        }
    });

});
</script>

<include file="Public:footer"/>
